import numpy as np

'''
序列化和反序列化
'''
def main():
    x = np.arange(10)
    # 序列化
    np.save('one_array', x)
    # 反序列化
    print(np.load('one_array.npy'))


    '''
    序列化多个
    '''
    y = np.arange(20)
    np.savez('two_array', a=x, b=y)

    c = np.load('two_array.npz')
    print(c['a'])
    print(c['b'])

if __name__ == '__main__':
    main()